导航菜单
首页 >  How to Run Insync as a Windows Service AlwaysUp  > How to run an AutoHotkey executable as a Windows Service

How to run an AutoHotkey executable as a Windows Service

Download and install AlwaysUp, if necessary.

Start AlwaysUp.

Select Application > Add to open the Add Application window:

On the General tab:

In the Application field, enter the full path to your compiled AutoHotkey executable.In this tutorial, we are running thesimple text editor with menu bar example, compiled into an executable called AHKSampleTextEditor.exe.

In the Name field, enter the name that you will call your application in AlwaysUp.We have used AutoHotkey Executable but you can specify virtually anything you like.

If you have any command line parameters for your AutoHotkey executable, enter those in the Arguments field. Our sample takes no parameters so we will leave that section blank in this tutorial.

Click the Save button to record your settings. In a couple of seconds, an application called AutoHotkey Executable (or whatever you called it) will appear in the AlwaysUp window.It is not yet running though.

To start your exe as a windows service, choose Application > Start "AutoHotkey Executable". The state should transition to Running momentarily:

On Windows 8.1/8/7/Vista and Server 2012/2008, your executable will be running in the background on theisolated Session 0.Select Tools > Switch to Session 0... to see any windows that your executable created:

You can also select Application > Restart "AutoHotkey Executable" in this session to quickly stop your AutoHotkey executable and start it again on your desktop.

Or setupautomatic login to get around Session 0 isolation...

That's it. Next time your computer boots, your AutoHotkey executable will start before anyone logs on.

As noted before, GUI applications may sometimes run into trouble when run as a windows service. Proceed cautiously and test thoroughly!

And finally, we encourage you to edit the application in AlwaysUp and check out the many other settings that may be appropriate for your environment.The 70+ page user's manual (PDF) describes them all.

相关推荐: